import type { AwardItemData } from '../../../shares/sharesApp';
import { awardScreen } from './screen';
import data from './JSON/Data.json';

export class Award {
    constructor() {}
    /**
     * 显示
     * @param award 奖项数据
     */
    show(award: AwardItemData | number | string) {
        switch (typeof award) {
            case 'number':
                awardScreen.update(
                    data[award as keyof typeof data] as AwardItemData | string
                );
                break;
            case 'object':
            case 'string':
                awardScreen.update(award);
                break;
        }
        awardScreen.show();
    }

    /**
     * 隐藏
     */
    hide() {
        awardScreen.hide();
    }
}

const award = new Award();
export default award;
